<?php

namespace common\models\PlugsRunDesc;

use Yii;

/**
 * This is the model class for table "plugs_run_desc".
 *
 * @property int $id
 * @property string $agent_id
 * @property string $pcname
 * @property string $adid 插件id
 * @property int $type 0无效 1有效
 * @property string $ip
 * @property string $wbid
 * @property string $created_date
 * @property string $city
 * @property string $err
 * @property string $mac
 * @property string $manager_uid
 * @property string $updated_time
 * @property int $is_collect 是否计入汇总
 * @property int $is_collect_fail 是否有汇总无效记录
 */
class PlugsRunDescBase extends \common\models\CommonModel\CommonModel
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'plugs_run_desc';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['agent_id', 'created_date', 'manager_uid'], 'required'],
            [['agent_id', 'adid', 'type', 'manager_uid', 'is_collect', 'is_collect_fail'], 'integer'],
            [['created_date', 'updated_time'], 'safe'],
            [['pcname', 'ip', 'city', 'err', 'mac'], 'string', 'max' => 255],
            [['wbid'], 'string', 'max' => 100],
            [['created_date', 'mac'], 'unique', 'targetAttribute' => ['created_date', 'mac']],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'agent_id' => 'Agent ID',
            'pcname' => 'Pcname',
            'adid' => 'Adid',
            'type' => 'Type',
            'ip' => 'Ip',
            'wbid' => 'Wbid',
            'created_date' => 'Created Date',
            'city' => 'City',
            'err' => 'Err',
            'mac' => 'Mac',
            'manager_uid' => 'Manager Uid',
            'updated_time' => 'Updated Time',
            'is_collect' => 'Is Collect',
            'is_collect_fail' => 'Is Collect Fail',
        ];
    }
}
